package com.pattern.structure.proxy;

/**
 * @author yangguanzan
 * @date 3/31/22
 * @description
 */
public class GamePlayerProxy implements IGamePlayer,IProxy {
    private IGamePlayer gamePlayer;
    private int fee;
    public GamePlayerProxy(String name) throws Exception {
        this.gamePlayer = new GamePlayer(this,name);
        this.fee = 0;
    }

    @Override
    public void login(String name, String password) {
        this.gamePlayer.login(name,password);
    }

    @Override
    public void killBoss() {
        this.gamePlayer.killBoss();
    }

    @Override
    public void upgrade() {
        this.gamePlayer.upgrade();
        this.fee += 100;
    }

    @Override
    public int getLevel() {
        return this.gamePlayer.getLevel();
    }

    /**
     * 结算代练费用
     */
    @Override
    public int countFee() {
        return this.fee;
    }
}
